from django.conf.urls.defaults import *
from blog.models import Post
from tagging.views import tagged_object_list
from blog.views import blog_rss

blog_dict = {
	'queryset' : Post.objects.all(),
	'date_field' : 'pub_date',
}

urlpatterns = patterns('django.views.generic.date_based',
  (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[0-9A-Za-z-]+)/$', 'object_detail', dict(blog_dict, slug_field='slug')),
  (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$','archive_day',blog_dict),
  (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$','archive_month', blog_dict),
  (r'^(?P<year>\d{4})/$','archive_year',  blog_dict),
  (r'^/?$', 'archive_index', blog_dict),
  (r'^rss/$', blog_rss),
  (r'^tags/(?P<tag>[^/]+(?u))/$', tagged_object_list, dict(model=Post, paginate_by=10, allow_empty=True)),
)
